package com.example.shaoguanapp.ui.dashboard;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;
import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;

import com.example.shaoguanapp.R;
import com.example.shaoguanapp.danxiashan;
import com.example.shaoguanapp.databinding.FragmentDashboardBinding;
import com.example.shaoguanapp.mabaren;
import com.example.shaoguanapp.nanhuasi;
import com.example.shaoguanapp.zhujiguxiang;

public class DashboardFragment extends Fragment {

    private FragmentDashboardBinding binding;
    private Button btns1,btns2,btns3,btns4;

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
        DashboardViewModel dashboardViewModel =
                new ViewModelProvider(this).get(DashboardViewModel.class);

        binding = FragmentDashboardBinding.inflate(inflater, container, false);
        View root = binding.getRoot();


        return root;


    }
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Button btns1 = getActivity().findViewById(R.id.btns1);
        btns1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), danxiashan.class);
                startActivity(intent);
            }
        });
        Button btns2 = getActivity().findViewById(R.id.btns2);
        btns2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), nanhuasi.class);
                startActivity(intent);
            }
        });

        Button btns3 = getActivity().findViewById(R.id.btns3);
        btns3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), zhujiguxiang.class);
                startActivity(intent);
            }
        });
        Button btns4 = getActivity().findViewById(R.id.btns4);
        btns4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), mabaren.class);
                startActivity(intent);
            }
        });
    }
    @Override
    public void onDestroyView() {
        super.onDestroyView();
        binding = null;
    }
}